using TMPro;
using UnityEngine;
using Voodoo.Pattern;

public class Multyplyer : MonoBehaviour
{
	[SerializeField]
	private TextMeshPro _t;

	[SerializeField]
	private bool _isX;

	[SerializeField]
	private bool _isCash;

	[SerializeField]
	private bool _isOil;

	[SerializeField]
	private bool _isPower;

	private void Start()
	{
		if (_isX)
		{
			float multyplyer = 1f + (float)Random.Range(2, 10) / 10f;
			Object.FindObjectOfType<Sell>().SetMultyplyer(multyplyer);
			_t.text = "x" + multyplyer;
		}
		else if (_isCash)
		{
			int num = Random.Range(10, 50) * 10;
			NintendoPlayerPrefs.SetFloat("Money", NintendoPlayerPrefs.GetFloat("Money", 0f) + (float)num);
			_t.text = num + "$";
		}
		else if (_isOil)
		{
			int value = Random.Range(5, 15);
			SingletonMB<GameManager>.Instance.currentOilUI.AddOil(value);
		}
		else if (_isPower)
		{
			int num2 = Random.Range(5, 20);
			Object.FindObjectOfType<PowerTimer>().StartTimer(num2);
		}
		Object.Destroy(base.gameObject, 2f);
	}
}
